package com.cmrx.model.util;

import com.alibaba.cloudapi.sdk.core.BaseApiClient;
import com.alibaba.cloudapi.sdk.core.BaseApiClientBuilder;
import com.alibaba.cloudapi.sdk.core.annotation.NotThreadSafe;
import com.alibaba.cloudapi.sdk.core.annotation.ThreadSafe;
import com.alibaba.cloudapi.sdk.core.enums.Method;
import com.alibaba.cloudapi.sdk.core.enums.ParamPosition;
import com.alibaba.cloudapi.sdk.core.enums.Scheme;
import com.alibaba.cloudapi.sdk.core.model.ApiRequest;
import com.alibaba.cloudapi.sdk.core.model.ApiResponse;
import com.alibaba.cloudapi.sdk.core.model.BuilderParams;

import java.util.Map;

@ThreadSafe
public final class SyncApiListClient extends BaseApiClient {

	
	public final static String GROUP_HOST = PropertyUtil.getValue("group_host");//提供的分组域名
	
	private SyncApiListClient(BuilderParams builderParams) {
		
		super(builderParams);
	}
	
	@NotThreadSafe
	public static class Builder extends BaseApiClientBuilder<SyncApiListClient.Builder, SyncApiListClient>{

		@Override
		protected SyncApiListClient build(BuilderParams params) {
			return new SyncApiListClient(params);
		}
	}

	public static Builder newBuilder(){

		return new SyncApiListClient.Builder();
	}
	 
	public static SyncApiListClient getInstance(){
		
		return getApiClassInstance(SyncApiListClient.class);
	}
	
	public ApiResponse APIList(Map<String, String> headerParams,String apiPath) {
	        ApiRequest _apiRequest = new ApiRequest(Scheme.HTTP, Method.GET, GROUP_HOST, apiPath);
	        _apiRequest.addMappedParams(headerParams, ParamPosition.HEADER);
	        return syncInvoke(_apiRequest);
	    }
}
